﻿@model CashFlow.Entities.Models.BillModel
@using CashFlow.Entities;

@using (Html.BeginForm())
{
	<div style="clear: both;">
	<div class="editor-field">
		<div id="radio">
			@Html.HiddenFor(m => m.AccountId)
			<div id="rbLabel">
				@Html.LabelFor(model => model.BillType)
			</div>
			@Html.RadioButtonFor(model => model.BillType,
				((short)BillType.Deposit).ToString(), new { id = "deposit", @name = "billTypeValue" })
			<label for="deposit">Deposit</label>
			@Html.RadioButtonFor(model => model.BillType,
					((short)BillType.Payment).ToString(), new { id = "payment", @name = "billTypeValue" })
			<label for="payment">Payment</label>
		</div>
		@Html.ValidationMessageFor(model => model.BillType)
	</div>
	<div class="formField">
		@Html.LabelFor(model => model.PayeeName)
		@Html.TextBoxFor(model => model.PayeeName)
		@Html.ValidationMessageFor(model => model.PayeeName)
	</div>
	<div class="formField">
		@Html.LabelFor(model => model.Amount)
		@Html.EditorFor(model => model.Amount)
		@Html.ValidationMessageFor(model => model.Amount)
	</div>
	<div class="formField">
		@Html.LabelFor(model => model.FirstDate)
		@Html.EditorFor(model => model.FirstDate, new { id = "firstDate" })
		@Html.ValidationMessageFor(model => model.FirstDate)
	</div>
	<div class="formField">
		@Html.LabelFor(model => model.LastDate)
		@Html.EditorFor(model => model.LastDate, new { id = "lastDate" })
		@Html.ValidationMessageFor(model => model.LastDate)
	</div>
	<div class="formField">
		@Html.LabelFor(model => model.RecurrenceId)
		@Html.DropDownListFor(model => model.RecurrenceId, Model.RecurrenceTypes)
	</div>
	<div class="formField">
		@Html.LabelFor(model => model.Details)
		@Html.TextAreaFor(model => model.Details)
		@Html.ValidationMessageFor(model => model.Details)
	</div>
	<div class="submitButtonsPanel">
		<input type="submit" value="Save" />&nbsp;or&nbsp;
		@Html.ActionLink("Cancel", "Index", null, new { id = "cancelLink" })
	</div>
	<div>
		@Html.ValidationSummary(true) 
	</div>
	</div>
}
<script type="text/javascript">
	$(function () {
		$("#FirstDate").datepicker();
		$("#LastDate").datepicker();
		$('label[for="BillType"]').addClass('billType');
	});
</script>
